<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>

<script>
    let nums = [123, 342, 432, 213, 345];

    let maxNum = nums[0];

    nums.forEach(function (item) {
        maxNum = item > maxNum ? item : maxNum;
    })

    console.log(maxNum);
</script>
</body>
</html>
